// @ts-ignore
/* eslint-disable */
import { request } from 'umi';

/** 获取报警条件列表 GET /api/alarm/condition */
export async function queryAlarmCondition(
  params: {
    // query
    /** 当前的页码 */
    current?: number;
    /** 页面的容量 */
    pageSize?: number;
  },
  options?: { [key: string]: any },
) {
  return request<API.RequestData>('/api/alarm/condition', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 更新报警条件 PUT /api/alarm/condition */
export async function updateAlarmCondition(
  body: API.AlarmConditionItem,
  options?: { [key: string]: any },
) {
  return request<Record<string, any>>('/api/alarm/condition', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 添加报警条件 POST /api/alarm/condition */
export async function addAlarmCondition(
  body: API.AlarmConditionItem,
  options?: { [key: string]: any },
) {
  return request<Record<string, any>>('/api/alarm/condition', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 删除报警条件 DELETE /api/alarm/condition */
export async function removeAlarmCondition(options?: { [key: string]: any }) {
  return request<Record<string, any>>('/api/alarm/condition', {
    method: 'DELETE',
    ...(options || {}),
  });
}
